package com.medata.service.impl;

import com.medata.dataObject.Areafilter;
import com.medata.repository.AreafilterRepository;
import com.medata.service.AreafilterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：zb
 * @date ：Created in 2019/6/10 0010 10:03
 * @description：
 */
@Service
public class AreafilterServiceImpl implements AreafilterService {
    @Autowired
    private AreafilterRepository repository;
    @Override
    public List<Areafilter> findAll() {
        List<Areafilter> all = repository.findAll();
        return all;
    }

    @Override
    public void delete(Areafilter areafilter) {
        repository.delete(areafilter);
    }

    @Override
    public void saveOrupdate(Areafilter areafilter) {
        repository.save(areafilter);
    }

    @Override
    public Areafilter findByAreaname(String name) {
        Areafilter areafilter = repository.findByAreaname(name);
        return areafilter;
    }

    @Override
    public Page<Areafilter> findAll(Pageable pageable) {
        Page<Areafilter> all = repository.findAll(pageable);
        return all;
    }

    @Override
    public Areafilter findByAreaid(Integer id) {
        return repository.findByAreaid(id);
    }
}
